﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using ZH.Infrastructure.Dto.Request.Order;
using ZH.Infrastructure.Dto.Request.Yuyue;
using ZH.Service.Instance;
using ZH.Service.Interface;

namespace ZH.Api.Admin.Controllers.Cashier
{
    /// <summary>
    /// 收银端·预约
    /// </summary>
    public class C_AppointmentController : BaseController
    {
        private readonly I_Yuyue_Service _yuyue_Service;

        public C_AppointmentController(I_Login_Service login_Service, I_Yuyue_Service yuyue_Service) : base(login_Service) 
        {
            _yuyue_Service = yuyue_Service;
        }

        /// <summary>
        /// 获取预约列表
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<IActionResult> Get_Cashier_Appointment()
        {
            var result = await _yuyue_Service.Get_Cashier_Appointment();

            return Ok(result);
        }

        /// <summary>
        /// 获取所有空闲状态的房间
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<IActionResult> Get_Cashier_Room()
        {
            var result = await _yuyue_Service.Get_Cashier_Room();

            return Ok(result);
        }

        /// <summary>
        /// 获取所有空闲状态的技师
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<IActionResult> Get_Cashier_Emp()
        {
            var result = await _yuyue_Service.Get_Cashier_Emp();

            return Ok(result);
        }

        /// <summary>
        /// 获取所有服务项目
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<IActionResult> Get_Cashier_Tech()
        {
            var result = await _yuyue_Service.Get_Cashier_Tech();

            return Ok(result);
        }

        /// <summary>
        /// 预约转订单
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<IActionResult> Cashier_Order_Appointment(Yuyue_Cashier_Request_Dto dto)
        {
            var result = await _yuyue_Service.Cashier_Order_Appointment(dto);

            return Ok(result);
        }
    }
}
